package ccpc;

import java.util.Scanner;

public class Problem1045 {

	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int m = cin.nextInt();
		int n = cin.nextInt();
		int bigger = 0;
		int smaller = 0;
		if(m > n) {
			bigger = m;
			smaller = n;
		}else {
			bigger = n;
			smaller = m;
		}
		int max = 0;
		int min = 0;
		for (int i = 1; i <= smaller; i++) {
			if(m%i==0&&n%i==0)
				max = i;
		}
		for (int i = 1; ; i++) {
			if((bigger*i)%smaller == 0) {
				min = bigger*i;
				break;
			}
		}
		System.out.println(max+" "+min);
	}

}
